<%template _header%>
<!--header end-->

<!--TheCurrent start-->
<div id="foruminfo">
	
	<div class="userinfo">
		<h2><a href="{Config.WebsiteUrl}" class="home">{Config.WebsiteTitle}</a>
			  <span><a href="usercp.aspx">用户中心</a></span>
			  <strong>更改密码</strong>
		</h2>
	</div>
	
	<div class="forumstats">
		<div id="search">
				<%template _quicksearch%>
		</div>
	</div>
	
</div>
<!--TheCurrent end-->

<script type="text/javascript">
	var opwdok = false;
	var pwdok = false;
	var pwd1ok = false;
	
	function checkform()
	{
		if(opwdok == false) pwd1ok = checkoldpwd();
	   if(pwd1ok == false) pwd1ok = checkpwd1();
	   if(pwdok == false) pwdok = checkpwd2();
	   if(opwdok && pwd1ok && pwdok){ 
	      var f = $("pwdform");
	      f.submit();
	    }
	}
	
     function checkoldpwd()
	  {
	  	  var pwd1 = $("oldpassword").value;
	  	  if(pwd1 == "") {
			  	$("opwdResult").innerHTML = "<font color='#009900'>请输入原密码</font>";
			  	opwdok = false;
			  	return false;
			  }
			  else if(pwd1.length < 6){
			  	$("opwdResult").innerHTML = "<font color='#009900'>不得少于6个字符</font>";
			  	opwdok = false;
			  	return false;
			  }
			  opwdok = true;
			  $("opwdResult").innerHTML = "";
			  return true;
	  }
		
	  function checkpwd1()
	  {
	  	  var pwd1 = $("newpassword").value;
	  	  if(pwd1 == "") {
			  	$("pwdResult").innerHTML = "<font color='#009900'>请输入新密码</font>";
			  	pwd1ok = false;
			  	return false;
			  }
			  else if(pwd1.length < 6){
			  	$("pwdResult").innerHTML = "<font color='#009900'>不得少于6个字符</font>";
			  	pwd1ok = false;
			  	return false;
			  }
			  pwd1ok = true;
			  $("pwdResult").innerHTML = "";
			  return true;
	  }
		
		function checkpwd2()
		{
			  $("pwd2Result").innerHTML= "";
			  if(pwd1ok == false) return false;
			  
			  var pwd1 = $("newpassword").value;
			  var pwd2 = $("newpassword2").value;
			  document.getElementById("pwd2Result").innerHTML = "";
			  
			  if(pwd1 != pwd2)
			  {
			  	$("pwd2Result").innerHTML = "<font color='#009900'>两次输入的密码不一致</font>";
			  	pwdok = false;
			  	return false;
			  }
			  
			  pwdok = true;
			  return true;
		}
</script>

<!--主体-->
<div class="controlpannel">
   <%template _memmenu%>
	<div class="pannelcontent">
		<div class="pcontent">
			<div class="panneldetail">
				<%template _membasemenu%>	
				<div class="pannelbody">
					<div class="pannellist">
					<%if ErrorCount==0%>
					
						<%if IsPost%>
						
							<%template _msgbox%>
							
						<%else%>
						
							<form action="" method="post" ID="pwdform">
								
								<label for="oldpassword">原密码:</label>
								<input name="oldpassword" type="password" class="colorblue" id="oldpassword" 
								       onfocus="this.className='colorfocus';"
								       onblur="this.className='colorblue';checkoldpwd();"
								        size="20" />&nbsp;<span id="opwdResult"></span>
								<br />
								
								<label for="newpassword">新密码:</label>
								<input name="newpassword" type="password" class="colorblue" id="newpassword" 
								       onfocus="this.className='colorfocus';" 
								       onblur="this.className='colorblue'; checkpwd1();" 
								       size="20" />&nbsp;<span id="pwdResult">不得少于6个字符</span>
								<br />
								
								<label for="newpassword2">重复新密码:</label>
								<input name="newpassword2" type="password" class="colorblue" id="newpassword2" 
								       onfocus="this.className='colorfocus';" 
								       onblur="this.className='colorblue'; checkpwd2();"
								       size="20" />&nbsp;<span id="pwd2Result"></span>
								<br />
								
								<br />
								
								<label for="Submit">&nbsp;</label>
								<input type="button" name="btnSubmit" value="确定" class="sbutton" 
								       ID="btnSubmit" onclick="checkform();"/>
						
							</form>
							
						<%/if%>
						
						</div>
						
					<%else%>
						<%template _memerrmsgbox%>
					<%/if%>
					
			  </div>
			</div>
		</div>
	</div>
</div>
<!--主体-->
</div>
<%template _copyright%>
<%template _footer%>
